package com.link2room.jetfire.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by sss on 2016/9/20.
 */
@Entity
@Table(name = "reservation_payment", catalog = "")
@DynamicInsert
public class ReservationPayment extends BaseEntity{
    public enum ReservationPayment_{
        l2RNo,terminalNo,mcCode,resDate,payType,amount,taCode,taNo,pmsPaysta,checkSta,soaPayment,soaOtherFee,soaCommissionTotal
    }
    /**
     * 联房订单号
     */
    private String l2RNo;
    /**
     * 终端订单号
     */
    private String terminalNo;
    /**
     * 活动代码
     */
    private String mcCode;
    /**
     * 日期
     */
    private Date resDate;
    /**
     * 支付方式
     */
    private String payChannel;
    /**
     * 支付方式
     */
    private String payType;
    /**
     * 金额
     */
    private BigDecimal amount;
    /**
     * 支付代码
     */
    private String taCode;
    /**
     * 支付单号
     */
    private String taNo;
    /**
     * PMS支付状态:NONE未操作，DONE已操作，FAIL失败，REJECT撤销
     */
    private String pmsPaysta;
    /**
     * L2R支付状态:NONE未操作，DONE已操作，FAIL失败，REJECT撤销
     */
    private String l2rPaysta;
    /**
     * 对账状态:NONE未对账，CHECKED对账成功，ERAMOUNT金额异常，ERLOSE丢单
     */
    private String checkSta;
    /**
     * 对账单总房费
     */
    private BigDecimal soaPayment;
    /**
     * 对账单杂费总额
     */
    private BigDecimal soaOtherFee;
    /**
     * 对账单扣除第三方佣金后金额
     */
    private BigDecimal soaCommissionTotal;

    private String remark;

    @Basic
    @Column(name = "l2r_no", nullable = true, length = 32)
    public String getL2RNo() {
        return l2RNo;
    }

    public void setL2RNo(String l2RNo) {
        this.l2RNo = l2RNo;
    }

    @Basic
    @Column(name = "terminal_no", nullable = true, length = 32)
    public String getTerminalNo() {
        return terminalNo;
    }

    public void setTerminalNo(String terminalNo) {
        this.terminalNo = terminalNo;
    }

    @Basic
    @Column(name = "mc_code", nullable = true, length = 32)
    public String getMcCode() {
        return mcCode;
    }

    public void setMcCode(String mcCode) {
        this.mcCode = mcCode;
    }

    @Basic
    @Column(name = "res_date", nullable = false)
    public Date getResDate() {
        return resDate;
    }

    public void setResDate(Date resDate) {
        this.resDate = resDate;
    }

    @Basic
    @Column(name = "pay_channel", nullable = true, length = 32)
    public String getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    @Basic
    @Column(name = "pay_type", nullable = true, length = 32)
    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    @Basic
    @Column(name = "amount", nullable = false, precision = 2)
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "ta_code", nullable = true, length = 30)
    public String getTaCode() {
        return taCode;
    }

    public void setTaCode(String taCode) {
        this.taCode = taCode;
    }

    @Basic
    @Column(name = "ta_no", nullable = true, length = 50)
    public String getTaNo() {
        return taNo;
    }

    public void setTaNo(String taNo) {
        this.taNo = taNo;
    }

    @Basic
    @Column(name = "pms_paysta", nullable = true, length = 10)
    public String getPmsPaysta() {
        return pmsPaysta;
    }

    public void setPmsPaysta(String pmsPaysta) {
        this.pmsPaysta = pmsPaysta;
    }

    @Basic
    @Column(name = "l2r_paysta", nullable = true, length = 10)
    public String getL2rPaysta() {
        return l2rPaysta;
    }

    public void setL2rPaysta(String l2rPaysta) {
        this.l2rPaysta = l2rPaysta;
    }

    @Basic
    @Column(name = "check_sta", nullable = true, length = 10)
    public String getCheckSta() {
        return checkSta;
    }

    public void setCheckSta(String checkSta) {
        this.checkSta = checkSta;
    }

    @Basic
    @Column(name = "soa_payment", nullable = true, precision = 2)
    public BigDecimal getSoaPayment() {
        return soaPayment;
    }

    public void setSoaPayment(BigDecimal soaPayment) {
        this.soaPayment = soaPayment;
    }

    @Basic
    @Column(name = "soa_other_fee", nullable = true, precision = 2)
    public BigDecimal getSoaOtherFee() {
        return soaOtherFee;
    }

    public void setSoaOtherFee(BigDecimal soaOtherFee) {
        this.soaOtherFee = soaOtherFee;
    }

    @Basic
    @Column(name = "soa_commission_total", nullable = true, precision = 2)
    public BigDecimal getSoaCommissionTotal() {
        return soaCommissionTotal;
    }

    public void setSoaCommissionTotal(BigDecimal soaCommissionTotal) {
        this.soaCommissionTotal = soaCommissionTotal;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 64)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ReservationPayment that = (ReservationPayment) o;

        if (l2RNo != null ? !l2RNo.equals(that.l2RNo) : that.l2RNo != null) return false;
        if (terminalNo != null ? !terminalNo.equals(that.terminalNo) : that.terminalNo != null) return false;
        if (resDate != null ? !resDate.equals(that.resDate) : that.resDate != null) return false;
        if (payType != null ? !payType.equals(that.payType) : that.payType != null) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (taCode != null ? !taCode.equals(that.taCode) : that.taCode != null) return false;
        if (taNo != null ? !taNo.equals(that.taNo) : that.taNo != null) return false;
        if (pmsPaysta != null ? !pmsPaysta.equals(that.pmsPaysta) : that.pmsPaysta != null) return false;
        if (checkSta != null ? !checkSta.equals(that.checkSta) : that.checkSta != null) return false;
        if (soaPayment != null ? !soaPayment.equals(that.soaPayment) : that.soaPayment != null) return false;
        if (soaOtherFee != null ? !soaOtherFee.equals(that.soaOtherFee) : that.soaOtherFee != null) return false;
        if (soaCommissionTotal != null ? !soaCommissionTotal.equals(that.soaCommissionTotal) : that.soaCommissionTotal != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = l2RNo != null ? l2RNo.hashCode() : 0;
        result = 31 * result + (terminalNo != null ? terminalNo.hashCode() : 0);
        result = 31 * result + (resDate != null ? resDate.hashCode() : 0);
        result = 31 * result + (payType != null ? payType.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (taCode != null ? taCode.hashCode() : 0);
        result = 31 * result + (taNo != null ? taNo.hashCode() : 0);
        result = 31 * result + (pmsPaysta != null ? pmsPaysta.hashCode() : 0);
        result = 31 * result + (checkSta != null ? checkSta.hashCode() : 0);
        result = 31 * result + (soaPayment != null ? soaPayment.hashCode() : 0);
        result = 31 * result + (soaOtherFee != null ? soaOtherFee.hashCode() : 0);
        result = 31 * result + (soaCommissionTotal != null ? soaCommissionTotal.hashCode() : 0);
        return result;
    }
}
